package com.gxc.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author GongXincheng
 * @since 2019-08-19 22:01
 */
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced   // Ribbon 是客户端负载均衡工具，要想使用客户端通过Eureka访问provider工程，必须加此注解.
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
